<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>1101: Tools.JsonHelper类参考</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- 制作者 Doxygen 1.7.2 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'搜索');
--></script>
<div class="navigation" id="top">
  <div class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>首页</span></a></li>
      <li><a href="namespaces.html"><span>包</span></a></li>
      <li class="current"><a href="annotated.html"><span>类</span></a></li>
      <li id="searchli">
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="搜索" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>组合类型列表</span></a></li>
      <li><a href="classes.html"><span>组合类型索引</span></a></li>
      <li><a href="hierarchy.html"><span>类继承关系</span></a></li>
      <li><a href="functions.html"><span>组合类型成员</span></a></li>
    </ul>
  </div>
  <div class="navpath">
    <ul>
      <li><a class="el" href="namespace_tools.html">Tools</a>      </li>
      <li><a class="el" href="class_tools_1_1_json_helper.html">JsonHelper</a>      </li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#pub-static-methods">静态公有成员</a>  </div>
  <div class="headertitle">
<h1>Tools.JsonHelper类参考</h1>  </div>
</div>
<div class="contents">
<!-- doxytag: class="Tools::JsonHelper" -->
<p>JsonHelper类  
<a href="#_details">更多...</a></p>

<p><a href="class_tools_1_1_json_helper-members.html">所有成员的列表。</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-static-methods"></a>
静态公有成员</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_tools_1_1_json_helper.html#a7ffbd5b6a6a73b6a23a9497d03d7d6f2">ListToJson&lt; T &gt;</a> (IList&lt; T &gt; list, string jsonName)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">List转成json.  <a href="#a7ffbd5b6a6a73b6a23a9497d03d7d6f2"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_tools_1_1_json_helper.html#af5acf27f06957401c1e196d3a35e5097">ListToJson&lt; T &gt;</a> (IList&lt; T &gt; list)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">List转成json.  <a href="#af5acf27f06957401c1e196d3a35e5097"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_tools_1_1_json_helper.html#ab9418e1b78b02ded9d00d901d5a2cc5a">ToJson</a> (object jsonObject)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">对象[dui xiang]转换[zhuan huan]为Json字符[zi fu]串[zi fu chuan]  <a href="#ab9418e1b78b02ded9d00d901d5a2cc5a"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_tools_1_1_json_helper.html#aabac95d9bcd31199d10096423ac0be22">ToJson</a> (IEnumerable array)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">对象[dui xiang]集合转换[zhuan huan]<a class="el" href="class_tools_1_1_json.html" title="Json的摘要说明 1、生成[{},{},{}]形式。普通格式 2、生成{&quot;total&quot;:5,&quot;rows&quot;:[{},{}]}形式。easyui json格式 3、...">Json</a>  <a href="#aabac95d9bcd31199d10096423ac0be22"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_tools_1_1_json_helper.html#a250559c2cb2739ab638ac67665020f7a">ToJson</a> (DataTable dt)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Datatable转换[zhuan huan]为Json.  <a href="#a250559c2cb2739ab638ac67665020f7a"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_tools_1_1_json_helper.html#a0aaeca493289a7069b30e6c614f0fd61">ToJson</a> (DataTable dt, string jsonName)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">DataTable转成Json.  <a href="#a0aaeca493289a7069b30e6c614f0fd61"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_tools_1_1_json_helper.html#a3b8bb86ba9fee5e7be1ed01555e59137">ToJsonEasyUi</a> (DataTable dt, string jsonName)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">DataTable转成Json.  <a href="#a3b8bb86ba9fee5e7be1ed01555e59137"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_tools_1_1_json_helper.html#a0be67d68b916f53fb9fe56d143ce4ece">ToJson</a> (DbDataReader dataReader)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">DataReader转换[zhuan huan]为Json.  <a href="#a0be67d68b916f53fb9fe56d143ce4ece"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_tools_1_1_json_helper.html#a91457fa0fe01ac0d45b06cc3548fb8ac">ToJson</a> (DataSet dataSet)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">DataSet转换[zhuan huan]为Json.  <a href="#a91457fa0fe01ac0d45b06cc3548fb8ac"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_tools_1_1_json_helper.html#a1baaaf30e58936908c1b9565c87ec406">ToArrayString</a> (IEnumerable array)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">普通集合转换[zhuan huan]<a class="el" href="class_tools_1_1_json.html" title="Json的摘要说明 1、生成[{},{},{}]形式。普通格式 2、生成{&quot;total&quot;:5,&quot;rows&quot;:[{},{}]}形式。easyui json格式 3、...">Json</a>  <a href="#a1baaaf30e58936908c1b9565c87ec406"></a><br/></td></tr>
</table>
<hr/><a name="_details"></a><h2>详细描述</h2>
<p>JsonHelper类 </p>
<hr/><h2>成员函数文档</h2>
<a class="anchor" id="a7ffbd5b6a6a73b6a23a9497d03d7d6f2"></a><!-- doxytag: member="Tools::JsonHelper::ListToJson&lt; T &gt;" ref="a7ffbd5b6a6a73b6a23a9497d03d7d6f2" args="(IList&lt; T &gt; list, string jsonName)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static string Tools.JsonHelper.ListToJson&lt; T &gt; </td>
          <td>(</td>
          <td class="paramtype">IList&lt; T &gt;&#160;</td>
          <td class="paramname"> <em>list</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">string&#160;</td>
          <td class="paramname"> <em>jsonName</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>List转成json. </p>
<dl><dt><b>Template Parameters:</b></dt><dd>
  <table class="">
    <tr><td class="paramname">T</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl><dt><b>参数:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">jsonName</td><td></td></tr>
    <tr><td class="paramname">list</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>返回:</b></dt><dd></dd></dl>

</div>
</div>
<a class="anchor" id="af5acf27f06957401c1e196d3a35e5097"></a><!-- doxytag: member="Tools::JsonHelper::ListToJson&lt; T &gt;" ref="af5acf27f06957401c1e196d3a35e5097" args="(IList&lt; T &gt; list)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static string Tools.JsonHelper.ListToJson&lt; T &gt; </td>
          <td>(</td>
          <td class="paramtype">IList&lt; T &gt;&#160;</td>
          <td class="paramname"> <em>list</em>&#160;)</td>
          <td><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>List转成json. </p>
<dl><dt><b>Template Parameters:</b></dt><dd>
  <table class="">
    <tr><td class="paramname">T</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl><dt><b>参数:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">list</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>返回:</b></dt><dd></dd></dl>

</div>
</div>
<a class="anchor" id="a1baaaf30e58936908c1b9565c87ec406"></a><!-- doxytag: member="Tools::JsonHelper::ToArrayString" ref="a1baaaf30e58936908c1b9565c87ec406" args="(IEnumerable array)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static string Tools.JsonHelper.ToArrayString </td>
          <td>(</td>
          <td class="paramtype">IEnumerable&#160;</td>
          <td class="paramname"> <em>array</em>&#160;)</td>
          <td><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>普通集合转换[zhuan huan]<a class="el" href="class_tools_1_1_json.html" title="Json的摘要说明 1、生成[{},{},{}]形式。普通格式 2、生成{&quot;total&quot;:5,&quot;rows&quot;:[{},{}]}形式。easyui json格式 3、...">Json</a> </p>
<dl><dt><b>参数:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">array</td><td>集合对象[dui xiang]</td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>返回:</b></dt><dd>Json字符[zi fu]串[zi fu chuan]</dd></dl>

</div>
</div>
<a class="anchor" id="a0be67d68b916f53fb9fe56d143ce4ece"></a><!-- doxytag: member="Tools::JsonHelper::ToJson" ref="a0be67d68b916f53fb9fe56d143ce4ece" args="(DbDataReader dataReader)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static string Tools.JsonHelper.ToJson </td>
          <td>(</td>
          <td class="paramtype">DbDataReader&#160;</td>
          <td class="paramname"> <em>dataReader</em>&#160;)</td>
          <td><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>DataReader转换[zhuan huan]为Json. </p>
<dl><dt><b>参数:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">dataReader</td><td>DataReader对象[dui xiang]</td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>返回:</b></dt><dd>Json字符[zi fu]串[zi fu chuan]</dd></dl>

</div>
</div>
<a class="anchor" id="a91457fa0fe01ac0d45b06cc3548fb8ac"></a><!-- doxytag: member="Tools::JsonHelper::ToJson" ref="a91457fa0fe01ac0d45b06cc3548fb8ac" args="(DataSet dataSet)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static string Tools.JsonHelper.ToJson </td>
          <td>(</td>
          <td class="paramtype">DataSet&#160;</td>
          <td class="paramname"> <em>dataSet</em>&#160;)</td>
          <td><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>DataSet转换[zhuan huan]为Json. </p>
<dl><dt><b>参数:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">dataSet</td><td>DataSet对象[dui xiang]</td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>返回:</b></dt><dd>Json字符[zi fu]串[zi fu chuan]</dd></dl>

</div>
</div>
<a class="anchor" id="a0aaeca493289a7069b30e6c614f0fd61"></a><!-- doxytag: member="Tools::JsonHelper::ToJson" ref="a0aaeca493289a7069b30e6c614f0fd61" args="(DataTable dt, string jsonName)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static string Tools.JsonHelper.ToJson </td>
          <td>(</td>
          <td class="paramtype">DataTable&#160;</td>
          <td class="paramname"> <em>dt</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">string&#160;</td>
          <td class="paramname"> <em>jsonName</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>DataTable转成Json. </p>
<dl><dt><b>参数:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">jsonName</td><td></td></tr>
    <tr><td class="paramname">dt</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>返回:</b></dt><dd></dd></dl>

</div>
</div>
<a class="anchor" id="a250559c2cb2739ab638ac67665020f7a"></a><!-- doxytag: member="Tools::JsonHelper::ToJson" ref="a250559c2cb2739ab638ac67665020f7a" args="(DataTable dt)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static string Tools.JsonHelper.ToJson </td>
          <td>(</td>
          <td class="paramtype">DataTable&#160;</td>
          <td class="paramname"> <em>dt</em>&#160;)</td>
          <td><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Datatable转换[zhuan huan]为Json. </p>
<dl><dt><b>参数:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">table</td><td>Datatable对象[dui xiang]</td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>返回:</b></dt><dd>Json字符[zi fu]串[zi fu chuan]</dd></dl>

</div>
</div>
<a class="anchor" id="aabac95d9bcd31199d10096423ac0be22"></a><!-- doxytag: member="Tools::JsonHelper::ToJson" ref="aabac95d9bcd31199d10096423ac0be22" args="(IEnumerable array)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static string Tools.JsonHelper.ToJson </td>
          <td>(</td>
          <td class="paramtype">IEnumerable&#160;</td>
          <td class="paramname"> <em>array</em>&#160;)</td>
          <td><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>对象[dui xiang]集合转换[zhuan huan]<a class="el" href="class_tools_1_1_json.html" title="Json的摘要说明 1、生成[{},{},{}]形式。普通格式 2、生成{&quot;total&quot;:5,&quot;rows&quot;:[{},{}]}形式。easyui json格式 3、...">Json</a> </p>
<dl><dt><b>参数:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">array</td><td>集合对象[dui xiang]</td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>返回:</b></dt><dd>Json字符[zi fu]串[zi fu chuan]</dd></dl>

</div>
</div>
<a class="anchor" id="ab9418e1b78b02ded9d00d901d5a2cc5a"></a><!-- doxytag: member="Tools::JsonHelper::ToJson" ref="ab9418e1b78b02ded9d00d901d5a2cc5a" args="(object jsonObject)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static string Tools.JsonHelper.ToJson </td>
          <td>(</td>
          <td class="paramtype">object&#160;</td>
          <td class="paramname"> <em>jsonObject</em>&#160;)</td>
          <td><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>对象[dui xiang]转换[zhuan huan]为Json字符[zi fu]串[zi fu chuan] </p>
<dl><dt><b>参数:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">jsonObject</td><td>对象[dui xiang]</td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>返回:</b></dt><dd>Json字符[zi fu]串[zi fu chuan]</dd></dl>

</div>
</div>
<a class="anchor" id="a3b8bb86ba9fee5e7be1ed01555e59137"></a><!-- doxytag: member="Tools::JsonHelper::ToJsonEasyUi" ref="a3b8bb86ba9fee5e7be1ed01555e59137" args="(DataTable dt, string jsonName)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static string Tools.JsonHelper.ToJsonEasyUi </td>
          <td>(</td>
          <td class="paramtype">DataTable&#160;</td>
          <td class="paramname"> <em>dt</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">string&#160;</td>
          <td class="paramname"> <em>jsonName</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>DataTable转成Json. </p>
<dl><dt><b>参数:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">jsonName</td><td></td></tr>
    <tr><td class="paramname">dt</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>返回:</b></dt><dd></dd></dl>

</div>
</div>
<hr/>该类的文档由以下文件生成：<ul>
<li>D:/Project/1101/Tools/JsonHelper.cs</li>
</ul>
</div>
<!--- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>全部</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>类</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>名字空间</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>函数</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>变量</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>枚举</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>属性</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<hr class="footer"/><address class="footer"><small>Generated at Sun Apr 10 2011 19:47:51 for 1101 by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.2 </small></address>
</body>
</html>
